import request from '@/util/index.js' 

export function loginForm(data){
	return request({
		url: '/appLogin',
		method: 'get',
		data: data
	 })
}

// 获取轮播图片列表
export function getBannerList(data){
	return request({
		url: '/system/banner/list',
		method: 'get',
		data: data
	 })
}

// 获取服务列表
export function getOrderProgress(data){
	return request({
		url: '/system/orderprogress/list',
		method: 'get',
		data: data
	 })
}

// 获取websoket数据
// export function getWebsocket(data){
// 	return request({
// 		url: `/system/repairorder/updateConfirmStatus`,
// 		method: 'put',
// 		data: data
// 	 })
// }

// 更新任务状态
export function updateConfirmStatus(data){
	return request({
		url: `/system/repairorder/updateConfirmStatus?orderId=${data.orderId}&confirmStatus=${data.confirmStatus}`,
		method: 'put',
	 })
}

export function categoryApi(data){
	return request({
		url: '/system/GoodsCategory/list?pageNum=1&pageSize=9999',
		method: 'get',
		data: data
	 })
}



export function adressDef(data){
	return request({
		url: '/wxuser/address/getDef',
		method: 'get',
		data: data
	 })
}

// 添加楼层
export function addCompanyRoom(data){
	return request({
		url: '/system/companyRoom/doAddByApp',
		method: 'post',
		data: data
	 })
}

// 修改楼层
export function editCompanyRoom(data){
	return request({
		url: '/system/companyRoom/doEdit',
		method: 'put',
		data: data
	 })
}

export function addCar(data){
	return request({
		url: '/system/shopCar/doAdd',
		method: 'POST',
		data: data
	 })
}





export function updateCar(data){
	return request({
		url: '/system/shopCar/doEdit',
		method: 'PUT',
		data: data
	 })
}


export function delCar(id){
	return request({
		url: '/system/shopCar/delete?id='+id,
		method: 'DELETE',
	 })
}

export function listCar(data){
	return request({
		url: '/system/shopCar/list',
		method: 'get',
		data: data
	 })
}


export function addOrder(data){
	return request({
		url: '/system/order/doAdd',
		method: 'post',
		data: data
	 })
}

export function doEditOrder(data){
	return request({
		url: '/system/order/doEdit',
		method: 'put',
		data: data
	 })
}

export function userOrderList(status){
	return request({
		url: '/system/order/userOrderList?pageNum=1&pageSize=9999&status='+status,
		method: 'get'
	 })
}
export function payOrder(orderNum){
	return request({
		url: '/system/order/payOrder?orderNum='+orderNum,
		method: 'get'
	 })
}


export function goodsListApi(data){
	return request({
		url: '/system/goods/list',
		method: 'get',
		data: data
	 })
}


// 获取轮播图信息
// system/banner/list

// 获取字典
export function getDict(data){
	return request({
		url: `/system/dict/data/list`,
		method: 'get',
		data: data
	 })
}

// 获取地址列表
export function getAddressList(data){
	return request({
		url: `/wxuser/address/list`,
		method: 'get',
		data: data
	 })
}

// 新增地址
export function addAddress(data){
	return request({
		url: `/wxuser/address/doAdd`,
		method: 'post',
		data: data
	 })
}

// 删除地址
export function deleteAddressInfo(data){
	return request({
		url: `/wxuser/address/${data}`,
		method: 'delete',
	 })
}

//修改地址
export function modifyAddress(data){
	return request({
		url: `/wxuser/address/doEdit`,
		method: 'put',
		data: data
	 })
}

//评价订单
export function updateRating(data){
	return request({
		url: `/system/repairorder/updateRating`,
		method: 'put',
		data: data
	 })
}

// 新增加盟
export function addRecruit(data){
	return request({
		url: `/system/recruit/doAdd`,
		method: 'post',
		data: data
	 })
}

// 新增工单
export function addRepairorder(data){
	return request({
		url: `/system/repairorder/doAdd`,
		method: 'post',
		data: data
	 })
}

// 新增设备
export function addDeviceinfo(data){
	return request({
		url: `/system/deviceinfo/doAdd`,
		method: 'post',
		data: data
	 })
}

// 获取工单列表
export function getRepairorder(data){
	return request({
		url: `/system/repairorder/list`,
		method: 'get',
		data: data
	 })
}

// 获取工单详情
export function getOrderById(data){
	return request({
		url: `/system/repairorder/getById`,
		method: 'get',
		data: data
	 })
}


//获取文章详情
export function getArticleInfo(data){
	return request({
		url: `/article/${data}`,
		method: 'get',
	 })
}

// 获取师傅端统计
export function getOrderStatistics(data){
	return request({
		url: `/system/master/statistics/orders`,
		method: 'get',
		data: data
	 })
}

// 获取师傅工单
export function getTeacherOrder(data){
	return request({
		url: `/system/master/statistics/orders/list`,
		method: 'get',
		data: data
	 })
}

export function getTeacherOrderDetail(data){
	return request({
		url: `/system/master/statistics/orders/${data}`,
		method: 'get'
	 })
}

// 获取服务记录
export function getRecentSevenDays(data){
	return request({
		url: `/system/repairorder/recentSevenDays`,
		method: 'get',
		data: data
	 })
}

export function getRecentSevenDaysByDevice(data){
	return request({
		url: `/system/task/recentSevenDaysByDevice`,
		method: 'get',
		data: data
	 })
}

// 查询巡检记录详情
export function getXunDetail(data){
	return request({
		url: `/system/task/${data}`,
		method: 'get',
	 })
}

//获取企业详情
export function getCooperationDetail(data){
	return request({
		url: `/system/cooperation/getById`,
		method: 'get',
		data: data
	 })
}

//巡检签到
export function xunSignIn(idd,data){
	return request({
		url: `/system/task/${idd}/signIn`,
		method: 'post',
		data: data
	 })
}

// 巡检签退
export function xunSignUp(idd,data){
	return request({
		url: `/system/task/${idd}/signOut`,
		method: 'post',
		data: data
	 })
}

// /dev-api/system/task/{taskId}/signOut

// 获取设备资产
export function getDeviceTree(data){
	return request({
		url: `/system/companyRoom/hierarchicalDeviceStats/${data}`,
		method: 'get',
	 })
}

// 获取设备详情
export function getDeviceDetail(data){
	return request({
		url: `/system/deviceinfo/getById`,
		method: 'get',
		data: data
	 })
}

//取消订单
export function cancelOrder(data){
	return request({
		url: `/system/repairorder/cancel/${data}`,
		method: 'put'
	 })
}

//获取标准
export function getServerContext(data){
	return request({
		url: `/system/serverContext/list`,
		method: 'get',
		data: data
	 })
}

//获取设备列表
export function getDeviceList(data){
	return request({
		url: `/system/deviceinfo/list`,
		method: 'get',
		data: data
	 })
}

// 公共上传接口
export function commonUpload(data){
	return request({
		url: `/common/upload`,
		method: 'post',
		data: data
	 })
}

// 商务合作
export function addBuss(data){
	return request({
		url: `/system/cooperation/doAdd`,
		method: 'post',
		data: data
	 })
}

//获取标准详情
export function getStandDetail(data){
	return request({
		url: `/system/serverContext/getById`,
		method: 'get',
		data: data
	 })
}

// 获取设备分类
export function getCategory(data){
	return request({
		url: `/system/category/list`,
		method: 'get',
		data: data
	 })
}

//根据设备号获取设备信息
export function getDeviceByCode(data){
	return request({
		url: `/system/deviceinfo/getByDeviceCode`,
		method: 'get',
		data: data
	 })
}

//获取设备分类
export function getTypeInfo(data){
	return request({
		url: `/system/category/list`,
		method: 'get',
		data: data
	 })
}

//获取配件清单
export function getInventory(data){
	return request({
		url: `/system/inventory/list`,
		method: 'get',
		data: data
	 })
}

// /dev-api/system/task/{orderId}/{deviceId}
export function getTaskItem(orderId,deviceId){
	return request({
		url: `/system/task/${orderId}/${deviceId}`,
		method: 'get'
	 })
}

// 完成任务
export function completeOrder(orderId,data){
	return request({
		url: `/system/repairorder/${orderId}/complete`,
		method: 'post',
		data: data
	 })
}



//批量提交质检项
export function submitResults(orderId,data){
	return request({
		url: `/system/task/${orderId}/submitResults`,
		method: 'post',
		data: data
	 })
}

//新增备件接口
export function addPurchaseOrder(data){
	return request({
		url: `/system/purchaseOrder`,
		method: 'post',
		data: data
	 })
}

// 
export function applyPartsInfo(idd,data){
	return request({
		url: `/system/repairorder/${idd}/applyParts`,
		method: 'post',
		data: data
	 })
}

// 签到 
export function teacherSingn(idd,data){
	return request({
		url: `/system/repairorder/${idd}/signIn`,
		method: 'post',
		data: data
	 })
}

// 获取楼层信息
export function getFloorList(data){
	return request({
		url: `/system/companyRoom/list`,
		method: 'get',
		data: data
	 })
}


//修改用户
export function updateUserInfo(data){
	return request({
		url: `/wxuser/wxuser/doEdit`,
		method: 'put',
		data: data
	 })
}

//获取用户详细信息
export function getUserInfoDetail(data){
	return request({
		url: `/wxuser/wxuser/getById`,
		method: 'get',
		data: data
	 })
}

// 注册用户
export function setUserInfo(data){
	return request({
		url: `/setUserInfo`,
		method: 'post',
		data: data
	 })
}